/*
 * @Description: tf命令入口
 * @Author: 听风
 * @Date: 2020-12-22 11:31:29
 */
const { program } = require('commander');
const version = require('../version');
const init = require('../funs/init');
const eggInit = require('../funs/egg');
const pubInit = require('../funs/pub');

program.storeOptionsAsProperties(false).passCommandToAction(false);

const main = async () => {
  // 版本
  program.version(version, '-v, --version');

  // init命令处理
  init(program);

  // egg相关命令
  eggInit(program);

  // pub相关命令
  pubInit(program);

  await program.parseAsync(process.argv);
};

module.exports = main;
